<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no" />
	<title>娱管家</title>  
    <meta name="format-detection" content="telephone=no">
    <meta name="msapplication-tap-highlight" content="no">
    <meta name="x5-orientation" content="portrait">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Access-Control-Allow-Origin" content="">
	<meta http-equiv="content-security-policy">
	<script type="text/javascript" src="js/jquery.min.js" ></script>
	<style>
		body{background-color: #fff;}
		body *{ padding: 0; margin: 0; font-size: 0.24rem; box-sizing: border-box; }
		ul,li,ol{ list-style: none; }
		.page{ width: 100%; height: 100%; position: fixed; top: 0; left: 0; }
		.page .top_bg{ width: 100%; height:4rem; background-color: #00ba1f; border-bottom-right-radius:1rem; border-bottom-left-radius:1rem;  }
		.page .page_con{ width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
		
		.page .page_con h2{ font-size: 0.4rem; line-height: 0.9rem; color: #fff; text-align: center; padding-bottom: 0.5rem; }
		.page .page_con .page_con_text{ border: 1px solid #e6e6e6; position: relative; width: 6rem; margin: 0 auto; padding: 0.7rem 0.2rem 0.2rem 0.3rem; border-radius: 0.1rem; background-color: #fff; }
		.logo{ position: absolute; top:-0.48rem; left: 2.53rem; width:0.94rem; height: 0.94rem; border-radius: 50%;  }
		.page .page_con .page_con_text p{ margin-bottom: 0.1rem; }
		.d{ color: #3d3d3d; }
		.r{ color: #ff2a21; }
		.page_con_pic{ width: 100%; height: 3rem; background-size: contain; background-repeat: no-repeat; background-position: center; background-image: url(images/erweima_1.png); }
		.page_con_b{ overflow: hidden; background-color: #f7f7fa; padding: 0.2rem; position: absolute; bottom: 0;  left: 0;  width: 100%;}
		.page_con_b>img{ float: left; width: 1.3rem; height: 1.3rem; display: block; margin-right: 0.1rem;}
		.page_con_b>div{float: left;  height: 1.3rem; font-size: 0.22rem; padding-top: 0.3rem;}
        .page_con_b>div p:nth-child(1) span{ color: #f00; }
	</style>
</head>
<body>
	<div class="page">
		<div class="top_bg"></div>
		<div class="page_con">
			<h2>娱管家</h2>
			<div class="page_con_text">
				<img src="images/erweima_logo.png" alt="" class="logo">
				<p >Hi,我是娱管家店主</p>
				<p class="d" style='font-size: 0.22rem;'>我的娱管家号：<span>52098</span></p>
				<p class="d">当娱管家店主，只要分享链接就能销售， 销售提成即时入账。</p>
				<p class="d">不用花钱囤货、不用打包发货，专业客服负责 售后，工作自由，生活自由！</p>
				<p class="r">下载App就可以免费领取各种礼品。</p>
			</div>
			<div class="page_con_pic"></div>
			<div class="page_con_b">
				<img src="images/erweima1.png" alt="" class="erweima">
				<div>
					<p>下载注册请输入推荐码：<span>222</span></p>
                    <p>长按识别二维码，购买茶叶即成店主</p>
				</div>
			</div>	
		</div>
	</div>
</body>
<script src="js/base.js"></script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script>
	$(function(){
		var h = $(window).height() - $('h2')[0].offsetHeight - $('.page_con_text')[0].offsetHeight -$('.page_con_b')[0].offsetHeight;
		$('.page_con_pic').height(h);
		var memberNum = GetQueryString('id');
		// $('.page_con_text p.d span').text(memberNum);
  //       $(".page_con_b div p").eq(1).find('span').text(memberNum);
        var url = 'http://www.yuzhuli.com/api.php/Api/download_no';
        $.post(url,{user_token:memberNum},function(res){
           $('.page_con_text p.d span').text(res.member_no);
           $(".page_con_b div p").eq(0).find('span').text(res.member_no);
        })
	})
	var share_link = location.href;
	var share_data = {
        title: '娱管家',// 设置分享标题
        desc: '欢迎来到娱管家',// 设置分享描述
        link: share_link,// 设置分享链接
        img: 'http://www.yuzhuli.com/Share/images/share_logo.png'// 分享图片
    };
    getWxConfig(ApiList, wxConfigCallback, false);
	 // 分享
    function getWxConfig(ApiList, callback, debug) {    		
        $.ajax({
            url: 'http://www.yuzhuli.com/api.php/api/wechat_js_config',
            type: 'POST',
            dataType: 'json',
            data: {url: location.href,apis:ApiList,debug:debug},
        }).done(function (res) {
        	console.log(res);
            if (res.s) {
                var con = res.config;
                var wxConf = {
                    debug: debug,
                    appId: con.appId,
                    timestamp: con.timestamp,
                    nonceStr: con.nonceStr,
                    signature: con.signature,
                    jsApiList: ApiList
                };
                wx.config(wxConf);
                wx.ready(function () {
                    callback();
                });
            }
        }).fail(function () {
            console.log("error");
        }).always(function () {
            console.log("complete");
        });
    }
    var ApiList = [
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareQZone',
        'onMenuShareWeibo',
    ];	
    
    function wx_share(data, callback) {
        // 分享到朋友圈
        wx.onMenuShareTimeline({
            title: data.title, // 分享标题
            link: data.link, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
            imgUrl: data.img, // 分享图标
            success: function () {
                // 用户确认分享后执行的回调函数
            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
            }
        });
        // 分享给朋友
        wx.onMenuShareAppMessage({
            title: data.title, // 分享标题
            desc: data.desc, // 分享描述
            link: data.link, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
            imgUrl: data.img, // 分享图标
            type: '', // 分享类型,music、video或link，不填默认为link
            dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
            success: function () {
                // 用户确认分享后执行的回调函数
            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
            }
        });
        wx.onMenuShareQQ({
            title: data.title, // 分享标题
            desc: data.desc, // 分享描述
            link: data.link, // 分享链接
            imgUrl: data.img, // 分享图标
            success: function () {
            // 用户确认分享后执行的回调函数
            },
            cancel: function () {
            // 用户取消分享后执行的回调函数
            }
        });
        wx.onMenuShareQZone({
            title: data.title, // 分享标题
            desc: data.desc, // 分享描述
            link: data.link, // 分享链接
            imgUrl: data.img, // 分享图标
            success: function () {
            // 用户确认分享后执行的回调函数
            },
            cancel: function () {
            // 用户取消分享后执行的回调函数
            }
        });
        wx.onMenuShareWeibo({
            title: data.title, // 分享标题
            desc: data.desc, // 分享描述
            link: data.link, // 分享链接
            imgUrl: data.img, // 分享图标
            success: function () {
            // 用户确认分享后执行的回调函数
            },
            cancel: function () {
            // 用户取消分享后执行的回调函数
            }
        });
    }	
    var shareCallback = function (type, status) {
		
    }	
    var wxConfigCallback = function () {
        wx_share(share_data, shareCallback);	        
    }	
    
    wx.error(function (res) {
        console.log(JSON.stringify(res));
    });
    function GetQueryString(name){
	     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
	     var r = window.location.search.substr(1).match(reg);
	     if(r!=null)return  unescape(r[2]); return null;
	}
</script>
</html>
